package com.iis.hrms.persistence;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

/**
 * The persistent class for the position database table.
 */
@Entity
@Table(name = "position")
@NamedQueries({
        @NamedQuery(name = "Position.findAll", query = "SELECT p FROM Position p"),
        @NamedQuery(name = "Position.findById", query = "SELECT p FROM Position p WHERE p.id = :id"),
        @NamedQuery(name = "Position.findByPositionName", query = "SELECT p FROM Position p WHERE p.positionName = :positionName")})
public class Position implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(unique = true, nullable = false)
    private String id;

    @Column(name = "position_name", nullable = false, length = 255)
    private String positionName;

    // bi-directional many-to-one association to Employee
    @OneToMany(mappedBy = "position")
    private List<Employee> employees;

    // bi-directional many-to-one association to JobSeeker
    @OneToMany(mappedBy = "position")
    private List<JobSeeker> jobSeekers;

    // bi-directional many-to-one association to Divisi
    @ManyToOne
    @JoinColumn(name = "id_divisi", nullable = false)
    private Divisi divisi;

    // bi-directional many-to-one association to Question
    @OneToMany(mappedBy = "position")
    private List<Question> questions;

    public Position() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getPositionName() {
        return this.positionName;
    }

    public void setPositionName(String positionName) {
        this.positionName = positionName;
    }

    public List<Employee> getEmployees() {
        return this.employees;
    }

    public void setEmployees(List<Employee> employees) {
        this.employees = employees;
    }

    public List<JobSeeker> getJobSeekers() {
        return this.jobSeekers;
    }

    public void setJobSeekers(List<JobSeeker> jobSeekers) {
        this.jobSeekers = jobSeekers;
    }

    public Divisi getDivisi() {
        return this.divisi;
    }

    public void setDivisi(Divisi divisi) {
        this.divisi = divisi;
    }

    public List<Question> getQuestions() {
        return this.questions;
    }

    public void setQuestions(List<Question> questions) {
        this.questions = questions;
    }

}